using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using Rotempco.Core.ORM.Objects;

namespace Rotempco.Core.ORM.Logic
{
    public static class SymbolExtensions
    {
        public static string GetPropertyName<T, TReturn>(Expression<Func<T, TReturn>> expression)
        {
            return ((MemberExpression)expression.Body).Member.Name;
        }

        public static SymbolPair GetPropertyPair<T, TReturn>(Expression<Func<T, TReturn>> expression)
        {
            return new SymbolPair(((MemberExpression)expression.Body).Member.Name, expression.Body.Type);
        }
    }
}
